﻿//-----------------------------------
//Author:Alvin
//Date:20:55:07
//-----------------------------------

using System;

namespace ZWFrameWork
{
    public abstract class SingletonInstance<T> where T : class
    {
        private static T _instance;
        public static T Instance()
        {
            if (_instance == null)
            {
                _instance = (T)Activator.CreateInstance(typeof(T), true);
            }
            return _instance;
        }
        
        /// <summary>
        /// 初始化数据
        /// </summary>
        public abstract void InitData();
        /// <summary>
        /// 清理数据
        /// </summary>
        public abstract void ClearData();

    }
}